#include "Wolf.h"
#include "../data/GameInfo.h"

Wolf::Wolf()
{
    GameAnimation::InitFrameData(GameInfo::Instance().texturePool[TexId::TEX_WOLF_ATTACK],
                                 animAttack, 4, 4, false, nullptr, 0.1);
    GameAnimation::InitFrameData(GameInfo::Instance().texturePool[TexId::TEX_WOLF_DIE],
                                 animDie, 4, 9, false, [this] { OnDie(); }, 0.1);
    GameAnimation::InitFrameData(GameInfo::Instance().texturePool[TexId::TEX_WOLF_STANDBY],
                                 animStandBy, 4, 4);
    GameAnimation::InitFrameData(GameInfo::Instance().texturePool[TexId::TEX_WOLF_WALK],
                                 animWalk, 4, 4);
    for (int i = 0; i < Facing::SIZE; i++) {
        animRigidity[i].Copy(animDie[i]);
        animRigidity[i].rectSrcList = {animDie[i].rectSrcList[0]};
        animRigidity[i].timer.waitTime = 1;
        animRigidity[i].onFinished = [this] { OnRigidity(); };
    }
    attackMix = GameInfo::Instance().mixPool[MixId::MIX_WOLF_ATTACK];
}